<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>禾匠微店大师管理后台</title>
	<include file="Public:header"/>
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body class="login-bg">
   <form id="myform" method="post"  action="{:U('index/login')}"  onsubmit="return validata();">
    <div class="login">
      <div class="login-box">
        <h5>禾匠微店大师后台</h5>
        <div class="login-inputs">
          <div class="login-input">
            <i class="cm-user"></i>
            <input type="text" placeholder="请输入手机号" name="phone" id="phone">
          </div>
          <div class="login-input">
            <i class="cm-psw"></i>
            <input type="password" placeholder="请输入密码" name="passwd" id="passwd">
          </div>
        </div>
        <div class="login-submit">
          <input class="btn" type="submit" value="登录">
        </div>
      </div>
    </div>
	</form>
  </body>

<script>



function validata()
{
	var phone=$('#phone').val();
	var passwd=$('#passwd').val();



	if(phone=='')
	{
		 save('请填写手机号');
		 return false;
	}

	if(passwd=='')
	{
		 save('请填写密码');
		 return false;
	}

	$("#myform").ajaxSubmit({
		type: 'post', // 提交方式 get/post
		url: "{:U('index/login')}", // 需要提交的 url
		datatype:"json",
		success: function(data) { // data 保存提交后返回的数据，一般为 json 数据
			// 此处可对 data 作相关处理
			if(data['code']!='success')
			{
			 	save(data['msg']);
			}
			else
			{
			 	location.href="{:U('Orders/order_count')}";
			}


		}
	});

	return false;
}






</script>
</html>
